package com.rwy.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.rwy.util.DateUtil;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class StatisticsSummaryDTO  extends CommonConstant implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String a4Ratio;//A4占比
	private String r4Ratio;// 4R照片占比
	private String totalAmt; //总金额
	private String docRatio;// 文档占比
	private String identRatio;// 
	private String provePhRatio;//证件占比
	private Integer cancePrintNum;
	private Integer deviceCount;//设备总数
	private Integer printSuccNum;
	private Integer sheetCount;
	private Integer troubleDeviceNum;
	private String refundAmt;//退款金额
	private boolean isShowEarnings = false; //是否显示收益记录
	//
	private Integer printKindId;
	
	//报表查询数据
	private Integer kindType;
	private Integer dateType;
	private String typeCount;
	private String typeDate;
	
	//businesspartnerid
	private Integer businessPartnerID;
	
	private List<Integer> partnerIDS;
	
	private String startTime;
	private String endTime;
	
	public StatisticsSummaryDTO buildEndTime(){
		if(dateType == null) this.dateType = 1;
		this.endTime = DateUtil.getSimpleDate(new Date()) +" 23:59:59";
		////测试使用
		//this.endTime = "2017-05-15 23:59:59";
		return this;
	}
	
	
	public StatisticsSummaryDTO buildStartTime(){
		if(dateType == null) this.dateType = 1;
		String date = "";
		switch(dateType) {
			case 1:
				date = DateUtil.getSimpleDate(new Date()); 
				//测试使用
//				date = DateUtil.getCurrentDayNDayDate(-1);
				 break;
			case 2:
				date = DateUtil.getCurrentDayNDayDate(-6); 
				break;
			case 3:
				date = DateUtil.getCurrentDayNDayDate(-29);
				break;
		    default:
		    	date = DateUtil.getSimpleDate(new Date()); 
			break;
		}
		this.startTime = date + " 00:00:00";
		return this;
	}
}

  class CommonConstant {
    /** 查询日期类型 * (一天)*/
	public static  Integer date_type_day = 1;
	/** 查询日期类型 一周(七天) */
	public static  Integer date_type_week = 2;
	/** 查询日期类型  一个月(30天) */
	public static Integer date_type_month = 3;
	
	public static Integer print_kind_type_4R =801 ;
	
	public static Integer print_kind_type_A4 = 301;
	/** 身份证*/
	public static Integer print_kind_type_ident = 303;
	/** 证明照 */
	public static Integer print_kind_type_prove_photo = 805;
	/** 文档种类 **/
	public static Integer print_kind_type_document = 302;
	
	public static Integer print_record_succ = 101;
	/** 用户取消打印 */
	public static Integer print_record_cancel = 301;
	
	public static Integer trouble_terminal_status = 201;
	
	//1:4R照片 2: 证件照 3: 身份证件 4: 文档, 5 : 打印成功, 6: 取消打印, 7: 设备故障, 8: 退款记录, 9: 收益记录
	public static Map<Integer, Integer> printKindMap = new HashMap<Integer, Integer>();
	
	public static Map<Integer, String> printKindDesc = new HashMap<Integer, String>();
	
	static {
		printKindDesc.put(print_kind_type_4R, "4R照片");
		printKindDesc.put(print_kind_type_ident, "身份证");
		printKindDesc.put(print_kind_type_A4, "A4照片");
		printKindDesc.put(print_kind_type_prove_photo, "证件照");
		printKindDesc.put(print_kind_type_document, "文档");
		
		printKindMap.put(1, print_kind_type_4R);
		printKindMap.put(2, print_kind_type_prove_photo);
		printKindMap.put(3, print_kind_type_ident);
		printKindMap.put(4, print_kind_type_document);
		printKindMap.put(5, print_record_succ);
		printKindMap.put(6, print_record_cancel);
		printKindMap.put(7, trouble_terminal_status);
		printKindMap.put(8, print_kind_type_A4);
	}
	
}
